package com.zhuojy.equity.mall.admin.web.controller.car;

import com.zhuojy.equity.mall.admin.common.entity.po.car.TCarEtcPO;
import com.zhuojy.equity.mall.admin.common.pojo.ResultEntity;
import com.zhuojy.equity.mall.admin.service.car.TCarEtcService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author xrz
 * @version 1.0
 * @description:TODO
 * @date 2024/4/11 20:41
 */
@RestController
@RequiredArgsConstructor
@CrossOrigin
@RequestMapping("caretc")
public class TCarEtcController {
    @Autowired
    private TCarEtcService tCarEtcService;

    /**
     * 查询信息
     * @param tCarMaintainPO
     * @param pageSize
     * @param pageNum
     * @return
     */
    @RequestMapping("findetcrPagination")
    private ResultEntity findetcrPagination(@RequestBody TCarEtcPO tCarMaintainPO, @RequestParam("pageSize") Integer pageSize, @RequestParam("pageNum") Integer pageNum) {
        return tCarEtcService.findetcrPagination(tCarMaintainPO, pageSize, pageNum);
    }

    /**
     * 添加信息
     * @param tCarEtcPO
     * @return
     */
    @RequestMapping("addetc")
    private ResultEntity addetc(@RequestBody TCarEtcPO tCarEtcPO){
        return tCarEtcService.addetc(tCarEtcPO);
    }

    /**
     * 修改信息
     * @param tCarEtcPO
     * @return
     */
    @RequestMapping("upetc")
    private ResultEntity upetc(@RequestBody TCarEtcPO tCarEtcPO){
        return tCarEtcService.upetc(tCarEtcPO);
    }

    /**
     * 回显信息
     * @param id
     * @return
     */
    @RequestMapping("echoetc")
    private ResultEntity echoetc(@RequestParam("id") Integer id){
        return tCarEtcService.echoetc(id);
    }

    /**
     * 删除对应的信息
     * @param id
     * @return
     */
    @RequestMapping("deletc")
    private ResultEntity deletc(@RequestParam("id") Integer id){
        return tCarEtcService.deletc(id);
    }

    /**
     * 查询etc卡号
     * @return
     */
    @RequestMapping("getcaretc")
    private ResultEntity getcaretc(){
        return tCarEtcService.getcaretc();
    }
}
